﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace test0320
{
    public partial class Form1: Form
    {
        public Form1()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
        }

        /// <summary>
        /// 显示页面
        /// </summary>
        /// <param name="page"></param>
        private void ShowPage(UserControl page)
        {
            // 清空当前内容
            panelContainer.Controls.Clear();
            // 设置新页面填充整个 Panel
            page.Dock = DockStyle.Fill;
            // 添加页面到 Panel
            panelContainer.Controls.Add(page);
        }
        private void menuPage1_Click(object sender, EventArgs e)
        {
            ShowPage(new Page1());
        }

        private void menuPag2_Click(object sender, EventArgs e)
        {
            ShowPage(new Page2());
        }

        private void menuPage3_Click_1(object sender, EventArgs e)
        {
            ShowPage(new Page3());
        }

        private void tabPage1_Click(object sender, EventArgs e)
        {

        }
    }
}
